#ifndef __BUOLA_GUI_CPROPERTYTYPE_H__
#define __BUOLA_GUI_CPROPERTYTYPE_H__

#include <buola/gui.h>

#include <unordered_map>

namespace buola { namespace gui {

class CPropertyType
{
public:
    CPropertyType(const std::wstring &pName);
    virtual ~CPropertyType() {}

    const std::wstring &GetName()   {   return mName;   }

    virtual void InitValue(UAny&)=0;
    virtual void FinishValue(UAny&) {}

    virtual void Draw(const UAny&,img::CGC*,const CRect_d&)=0;
    virtual CPropertyEditor *GetEditor()=0;

public:
    static CPropertyType *GetType(const std::wstring &pName);
    static void RegisterType(const std::wstring &pName,CPropertyType *pType);

protected:
    std::wstring mName;
};

/*namespace gui*/ } /*namespace buola*/ }

#endif
